package com.szpx.service.impl;

import com.szpx.entity.Member;
import com.szpx.mapper.MemberMapper;
import com.szpx.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberMapper memberMapper;


    @Override
    public Member selectMemberById(Integer id) {
        return memberMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Member> selectAllMember() {
        return memberMapper.selectAll();
    }

    @Override
    public int addMember(Member member) {
        memberMapper.insertSelective(member);
        return 0;
    }

    @Override
    public int delMember(Integer id) {
        return memberMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int updateMember(Member member) {
        return memberMapper.updateByPrimaryKeySelective(member);
    }

    @Override
    public void login(Member member) {
        memberMapper.selectByPrimaryKey(member.getId());
        
        return ;
    }


}
